// components/workHeader/WorkHeader.js
const App = getApp();
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    activeValue: {
      type: Number,
      value: 0,
    },
    orgDatas: {
      type: Array,
      value: []
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    navBarHeight: 0,
    // value: 0,
  },



  lifetimes: {
    // attached() {
    //   console.log("sssfff: ", this.properties.orgDatas)
    // },
    ready() {
      // 获取状态栏高度 statusBarHeight 
      const windowInfo = wx.getWindowInfo()
      console.log("windowInfo: ", windowInfo.statusBarHeight, this.properties.orgDatas)
      this.setData({
        navBarHeight: windowInfo.statusBarHeight
      })
    },
  },



  /**
   * 组件的方法列表
   */
  methods: {
    changeMenu(e) {
      this.properties.orgDatas.forEach(item => {
        if (e.detail == item.value) {
          App.globalData.LoginDeptName = item.text;
        }
      })
      //存储机构id
      App.globalData.LoginDeptAuth = e.detail;
    },
  }
})